package com.znsb.msfq;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import butterknife.ButterKnife;


/**
 * 名称：基础Fragment类
 * 创建时间：2016/10/20.
 * 作者：杨广
 * 手机号：13330359437
 * 说明：
 */

public abstract class BaseFragment extends Fragment implements View.OnClickListener {

    private View view;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(getlayoutView(), container, false);
//        ButterKnife.bind(getActivity(), view);//绑定framgent
        return view;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        initView(view);
        initData();
    }

    protected abstract int getlayoutView();

    protected abstract void initView(View view);

    protected abstract void initData();

    protected abstract void clickListener(View view);

    @Override
    public void onClick(View view) {
        clickListener(view);
    }
}
